<extend name="Base/common"/>

<block name="body">
    <div id="aui-slide3">
        <div class="aui-slide-wrap" >
            <div class="aui-slide-node bg-dark">
                <img src="__IMG__/banner4.jpg" />
            </div>
        </div>
        <div class="aui-slide-page-wrap"><!--分页容器--></div>
    </div>
    <div style="height: 0.5rem;"></div>
    <div class="notice">
        <div class="content">
            <volist name="lists" id="val">
                <a href="{:U('Free/Article_detail',array('id'=>$val['id']))}">
                    <div class="p"><p class="aui-ellipsis-2">{$val.title}</p></div>
                    <div class="down">
                        <p class="date">{$val.create_time|date="Y-m-d",###}</p>
                        <p class="more">查看详情</p>
                    </div>
                </a>
            </volist>
        </div>
    </div>
    <div style="height: 1.5rem;"></div>
    <form id="form-post" action="" method="post" accept-charset="utf-8" onsubmit="return check_form()">
        <input type="hidden" name="cate_id" value="{$cate_id}"/>
        <div class="aui-content aui-margin-b-15">
            <ul class="aui-list aui-form-list">
                <li class="aui-list-header">填写信息</li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            姓名
                        </div>
                        <div class="aui-list-item-input">
                            <input type="text" name="name" placeholder="姓名">
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            电话
                        </div>
                        <div class="aui-list-item-input">
                            <input type="number" name="tel" placeholder="电话">
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            内容
                        </div>
                        <div class="aui-list-item-input">
                            <textarea name="content" placeholder="留下您想说的"></textarea>
                        </div>
                    </div>
                </li>
                <div style="height: 0.5rem;"></div>
                <input class="sub" type="submit" name="提交">
                <div style="height: 0.5rem;"></div>
            </ul>
        </div>
    </form>

    <div style="width: 100%;height: 3.5rem;background: #eceef3;"></div>
    <script>
        function  check_form(){
            var name = $("#form-post input[name='name']").val()
            var tel = $("#form-post input[name='tel']").val()
            var content = $("#form-post textarea[name='content']").val()
            var patrn=/^[\u4e00-\u9fa5\uf900-\ufa2d]{1,4}$/;
            if(!patrn.exec(name)){
                alert("请输入你的名字，1-4个汉字");
                return false;
            }
             patrn=/^1[34578]\d{9}$/;
            if(!patrn.exec(tel)){
                alert("请输入正确的电话号码");
                return false;
            }
            if($.trim(content)==""){
                alert('内容不能为空！');
                return false;
            }


        }
    </script>
</block>
<block name="footer_js">

</block>